package com.mmall.common;

import com.google.common.collect.Sets;
import com.mmall.pojo.Cart;

import java.util.Set;

public class Const {
    public static final String CURRENT_USER = "currentUser";
    public static final String USER_NAME = "userName";
    public static final String EMAIL = "email";
    public static final String TOKEN = "token_";

    public interface ProductListOrderBy{
        Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc","price_asc");
    }

    public interface Cart{
        int CHECKED = 1;//已勾选
        int NO_CHECKED = 0;//未勾选

        String LIMIT_NUM_FALL = "LIMIT_NUM_FALL";
        String LIMIT_NUM_SUCCESS = "LIMIT_NUM_SUCCESS";
    }

    public interface Role{
        int ROLE_CUSTOMER = 0;// 普通用户
        int ROLE_ADMIN = 1;//管理员
    }

    public enum ProductStatusEnum{
        ON_SALE(1,"在线");
        private String value;
        private int code;
        ProductStatusEnum(int code,String value){
            this.code = code;
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }
}
